﻿/*
    Copyright 2010, 2011 Eric Wong
	contact@optimalcycling.com
	http://www.optimalcycling.com
	Optimal Cycling - Advanced power pacing program for cyclists
	
	This file is part of Optimal Cycling.

    Optimal Cycling is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Optimal Cycling is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with Optimal Cycling.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _FILE_GENOME_H_
#define _FILE_GENOME_H_

#ifndef __OPENCL_VERSION__
	#include "Options.h"
	#include "Constants.h"
	#include "Vector.h"
	#include "Interpolate.h"
	#include "PowerMetrics.h"
	#include "RandomNumberGen.h"
#endif

/// <summary>
/// What phase of the solving cycle we are currently performing
/// </summary>
typedef enum 
{
	SolutionMode_Initialize,
	SolutionMode_NoOptimize,
    SolutionMode_EvaluateFitness,
	SolutionMode_SortByFitness,
    SolutionMode_Mate,
	SolutionMode_OutputAll,
	SolutionMode_IncrementParams,
	SolutionMode_Migrate,
	SolutionMode_DiffEvo,
	SolutionMode_Test
} SolutionMode;


/// <summary>
/// Holds the constant options for the solver together
/// </summary>
typedef struct 
{
    real2 diffEvoFLimits;
    real2 diffEvoCrLimits;
	real2 diffEvoSrLimits;

	// Butterworth limits
	real2 bwCutOffF;

	sizeT heuristicSeedIndexLow;
	sizeT heuristicSeedIndexHigh;
	
	ulong64 maxGensToRun;

	sizeT numIndividMigrate;
	ulong64 gensPerMigration;

	ulong64 convergenenceGenerations;
	real convergenceTolerance;

} SolverInfo;

/// <summary>
/// Holds the changing parameters for the solver together
/// </summary>
typedef struct 
{
	ulong64 currGen;
	real maxTime;
	sizeT raceTimeMeasureStartIndex;
} SolverVars;


#endif		// _FILE_GENOME_H_
